Skip to content

Conversation

@shreyas02
Copy link

As shown in issue #171

@codecov
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

Attention: Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (6694d26) to head (87fa43e).
Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
src/Visualization.jl 0.00% 24 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #174    +/-   ##
=======================================
  Coverage    0.00%   0.00%            
=======================================
  Files          11      11            
  Lines        3249    3349   +100     
=======================================
- Misses       3249    3349   +100     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shreyas02
Copy link
Author

Hi @JordiManyer, I just noticed that this has not yet been merged. Are you looking/working on any other "fixes" for this problem? Thanks!

@JordiManyer
Copy link
Member

You need to pull from master.

In any case, I am not convinced this is the best way of doing things.

For instance: If we are now passing the triangulation as input, why are we also passing the parts? Can't we just add a new method that has the triangulation instead of the parts?

Also: within the createpvd functions, everything is serial and only gets used within the master processor. So for instance, in

Visualization.createpvd(parts::AbstractArray,args...;kwargs...)

both args and kwargs are passed directly to vtk and therefore are serial. When we save the pvd file, we only do it in the master processor. Everything is only done on the master processor.

Why do we need to know the parts? I think we do not.

Only two changes are necessary: First, we check for empty parts when we want to save the individual files, i.e we only save the ones which have something. Second, we need to allow some flexibility for the main processor in case processor 1 is empty.

struct DistributedPvd{T<:AbstractArray}
  pvds::T
  main::Int
end

DistributedPvd(pvds) = DistributedPvd(pvds,1)

function Base.setindex!(pvd::DistributedPvd,pvtk::AbstractArray,time::Real)
  map(pvtk) do pvtk
    !isnothing(pvtk) && vtk_save(pvtk)
  end
  map(pvtk,pvd.pvds) do pvtk,pvd
    if part == pvd.main
      pvd[time] = pvtk
    end
  end
end

and you can pass main as a constructor kwarg, or make the struct mutable and set it up the first time you access setindex!, for instance.
Something like that, but I think there is some more thinking to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants